package top.aiprogram.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import top.aiprogram.entity.User;
import top.aiprogram.service.UserService;


@Controller
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("user")
    @ResponseBody
    public String getUserService(@RequestBody User user) {
        userService.creatUser(user);
        return "success";
    }

    @RequestMapping("demo")
    public String usr(@RequestBody Long id) {//打注解是为了能执行json格式转换
//        userService.creatUser(id);
        return "233";
    }
    //test操作-提交修改
}
